<?php
/**
 * Created by PhpStorm.
 * User: wuxin
 */

use \yii\helpers\Url;
use \yii\helpers\Html;

?>
<form id="form" class="form-horizontal" method="post">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel"><?= empty($id)?"添加":"编辑";?>评价</h4>
    </div>
    <div style="border-bottom: 1px solid #e5e5e5"></div>
    <div class="modal-body">
        <div class="box-body">
            <div class="form-group">
                <label class="col-sm-4 control-label">标题：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-title" name="EvaluForm[title]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述1：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc1" name="EvaluForm[desc1]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述2：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc2" name="EvaluForm[desc2]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述3：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc3" name="EvaluForm[desc3]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述4：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc4" name="EvaluForm[desc4]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述5：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc5" name="EvaluForm[desc5]">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-4 control-label">描述6：</label>
                <div class="input-group col-sm-6  required" style="padding-right: 15px;padding-left: 15px;">
                    <input class="form-control" type="text" id="EvaluForm-desc6" name="EvaluForm[desc6]">
                </div>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <?= Html::hiddenInput('_csrf-backend',\Yii::$app->getRequest()->csrfToken) ?>
        <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
        <button type="button" class="btn btn-primary" id="add-contral-ajax-submit">保存</button>
    </div>
</form>
<script>
    $('#add-contral-ajax-submit').click(function () {
        var data = $('#form').serialize();
        sendAjax('<?= Url::toRoute('add-evalu') ?>', data, $(this));
    });
</script>